﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="物料品种录入.aspx.cs" Inherits="syc.Jidong.物料品种录入" %>
<html>
<head>
<title></title>
</head>
<style>
div.autofinish{position:absolute; z-index:2;border:solid 1px #ccaa88;background-color:#ffffff;padding:5px;font-size:14px;color:#ff0000;}
#BianHao{background-image:url(/images/bmback.gif); background-repeat:no-repeat;}
</style>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
SelectCommand="select @品名=品名,@规格=规格,@单位=单位,@单价=cast(单价 as float),@简码=简码,@权重=权重,@大宗=大宗 from 物料品种 where ID=@ID"
InsertCommand="insert into 物料品种(ID,品名,规格,单位,单价,简码,权重,大宗)values(@ID,@品名,@规格,@单位,@单价,@简码,@权重,@大宗);"
UpdateCommand="update 物料品种 set 品名=@品名,规格=@规格,单位=@单位,单价=@单价,简码=@简码,权重=@权重,大宗=@大宗 where ID=@ID" 
onselected="SqlDataSource1_Selected"
>
<SelectParameters>
<asp:Parameter Name="ID" DbType="Int32"  Size="4"/>
<asp:Parameter Name="品名" DbType="String"  Size="40" Direction="Output"/>
<asp:Parameter Name="规格" DbType="AnsiString" Size="40" Direction="Output"/>
<asp:Parameter Name="单位" DbType="AnsiString"  Size="10" Direction="Output"/>
<asp:Parameter Name="单价" DbType="Double" Size="9" Direction="Output"/>
<asp:Parameter Name="简码" DbType="AnsiString"  Size="20" Direction="Output"/>
<asp:Parameter Name="权重" DbType="Int32"  Size="4" Direction="Output"/>
<asp:Parameter Name="大宗" DbType="Boolean" Size="1" Direction="Output"/>
</SelectParameters>
<InsertParameters>
<asp:ControlParameter Name="ID" DbType="Int32" Size="4" ControlID="Label_ID" />
<asp:ControlParameter Name="品名" DbType="String"  Size="40" ControlID="PinMing"/>
<asp:ControlParameter Name="规格" DbType="AnsiString" Size="40" ControlID="GuiGe"/>
<asp:ControlParameter Name="单位" DbType="AnsiString"  Size="10" ControlID="DanWei"/>
<asp:ControlParameter Name="单价" DbType="Decimal"  Size="9" ControlID="DanJia"/>
<asp:ControlParameter Name="简码" DbType="AnsiString"  Size="20" ControlID="JianMa"/>
<asp:ControlParameter Name="权重" DbType="Int32"  Size="4" ControlID="QuanZhong"/>
<asp:ControlParameter Name="大宗" DbType="Boolean" Size="1" ControlID="DaZong"/>
</InsertParameters>
<UpdateParameters>
<asp:ControlParameter Name="ID" DbType="Int32" Size="4" ControlID="Label_ID"/>
<asp:ControlParameter Name="品名" DbType="String"  Size="40" ControlID="PinMing"/>
<asp:ControlParameter Name="规格" DbType="AnsiString" Size="40" ControlID="GuiGe"/>
<asp:ControlParameter Name="单位" DbType="AnsiString"  Size="10" ControlID="DanWei"/>
<asp:ControlParameter Name="单价" DbType="Decimal"  Size="9" ControlID="DanJia"/>
<asp:ControlParameter Name="简码" DbType="AnsiString"  Size="20" ControlID="JianMa"/>
<asp:ControlParameter Name="权重" DbType="Int32"  Size="4" ControlID="QuanZhong"/>
<asp:ControlParameter Name="大宗" DbType="Boolean" Size="1" ControlID="DaZong"/>
</UpdateParameters>
</asp:SqlDataSource>
<asp:Label ID="Label_ID" runat="server" Text="" Visible="false"></asp:Label>

<div id="wintop" class="wintop" style="display:none;">物资品种录入</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_Save" runat="server" Text="保 存" UseSubmitBehavior="false" 
        CssClass="button" onclick="Button_Save_Click" />
    <input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel">
<table border="1" style="border-collapse:separate;font-size:14px;">
<tr height=30>
<td width=100 align=right>编 码：</td>
<td Width="160"><asp:TextBox ID="FID" runat="server" CssClass="textbox" Width="60" Enabled="false" BackColor="#eeeeee"></asp:TextBox><asp:TextBox ID="BianMa" runat="server" CssClass="textbox" Width="60" ></asp:TextBox><font color=red >*</font></td>
<td width=100  colspan=2 align=right>
    <asp:CheckBox ID="DaZong" runat="server" Text="大宗物料" /></td>
</tr>

<tr height=30>
<td align=right>品 名：</td>
<td><asp:TextBox ID="PinMing" runat="server" CssClass="textbox" Width="120" ></asp:TextBox><font color=red >*</font></td>
<td align=right>规 格：</td>
<td><asp:TextBox ID="GuiGe" runat="server" CssClass="textbox" Width="120" ></asp:TextBox></td>
</tr>
<tr height=30>
<td align=right>单 位：</td>
<td><asp:TextBox ID="DanWei" runat="server" CssClass="textbox" Width="120" ></asp:TextBox></td>
<td align=right>单价(元)：</td>
<td><asp:TextBox ID="DanJia" runat="server" CssClass="textbox" Width="120" ></asp:TextBox></td>
</tr>
<tr height=30>
<td align=right>简 码：</td>
<td nowrap><asp:TextBox ID="JianMa" runat="server" CssClass="textbox" Width="120" ></asp:TextBox>
<span style=font-size:13px;></span>
</td>
<td align=right>权 重：</td>
<td colspan=3 nowrap><asp:TextBox ID="QuanZhong" runat="server" CssClass="textbox" Width="120" ></asp:TextBox>
<span style=font-size:13px;></span>
</td>
</tr>
</table>
<font color=red >提示：</font>
<br />(1) “编码”为3位数字，取值范围为 001 ～ 999；
<br />(2) 标注<font color=red >*</font>表示必须填写；
<br />(3) “权重”为一个 0 ～ 10000 的数字，数值越大越表示物品越重要；
<br />(4) “简码”是为了方便录入的简单代码。
<br /><br />
</asp:Panel>


</form>

<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName != "INPUT" || tag.className != "textbox") return;
        if (tag.id == "BeiZhu") return;
        if (e.keyCode == 13) e.keyCode = 9;
    }

</script>
</body>
</html>
